package mc0352;
import java.util.Scanner;
public class Main {
	static int MOD = 100000007;
	public static void main(String[] args) {
		//System.out.println(isPrime(100000007));
		
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m = sc.nextLong();
		
		
		long a=1,b=1;
		for(long i=1;i<=m;i++) {
			a = a * (n-i+1) % MOD;
			b = b * i % MOD; 
		}
		//b在分母中，需要计算逆元，然后转成乘法
		long ans = a * binpowmod(b,MOD-2,MOD)%MOD;
		
		System.out.println(ans);

	}
	
	public static boolean isPrime(int num) {
	    if (num <= 1) {
	        return false;
	    }
	    if (num == 2) {
	        return true;
	    }
	    if (num % 2 == 0) {
	        return false;
	    }
	    for (int i = 3; i * i <= num; i += 2) {
	        if (num % i == 0) {
	            return false;
	        }
	    }
	    return true;
	}
	
	//快速幂算法
	//x的n次方
	//结果很容易超过long的取值范围
	//比如：29的13次方10260628712958602189
	//超过了long的范围，无法返回正确结果
	static long binpow(long x,long n) {
		long res = 1;
	    while (n > 0) {
	        if ((n & 1) == 1) {
	            res *= x;
	        }
	        x *= x;
	        n >>= 1;
	    }
	    return res;
	}
	
	//快速幂，结果对MOD取模
	static long binpowmod(long x,long n,long MOD) {
		x %= MOD;
		long res = 1;
	    while (n > 0) {
	        if ((n & 1) == 1) {
	            res = res * x % MOD;
	        }
	        x = x * x % MOD;
	        n >>= 1;
	    }
	    return res;
	}
	
	//计算除以b取模运算的逆元，MOD为质数
	//费马小定理应用
	static long liyuan(long b,long MOD) {
		return binpowmod(b,MOD-2,MOD);
	}
}
